#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#include<windows.h>
int i, j, k;
int paidui[40];  //定义牌堆
int player[6], player_shoupai_num;  //玩家手牌,手牌数
char c_player[6][20];  //玩家手牌字符
int npc[6],npc_shoupai_num;     //电脑手牌，手牌数
char c_npc[6][20];  //电脑手牌字符
int player_out; //玩家出牌号
int npc_out; //电脑出牌号
void  turn()
{
	int i;
	for (i = 0; player[i] != 0; i++)
	{
		if (player[i] == 1)
		{
			strcpy_s(c_player[i],"杀");
		}
		if (player[i] == 2)
		{
			strcpy_s(c_player[i], "闪");
		}
	}
	for (i = 0; npc[i] != 0; i++)
	{
		if (npc[i] == 1)
		{
			strcpy_s(c_npc[i], "杀");
		}
		if (npc[i] == 2)
		{
			strcpy_s(c_npc[i], "闪");
		}
	}
}       //用于数字换为汉字


void startup()
{
	for (i = 0; i < 40; i++)
	{
		paidui[i] = rand() % 2 + 1;//给牌堆赋值
	}

	for (j = 0; j < 4; j++)
	{
		k = rand() % 40;
		while (paidui[k] == 0)
		{
			k = rand() % 40;
		}
		player[j] = paidui[k];
		paidui[k] = 0;  //玩家抽四张牌，抽完牌堆处的数就清零
		player_shoupai_num = 4;
	}
	for (j = 0; j < 4; j++)
	{
		k = rand() % 40;
		while (paidui[k] == 0)
		{
			k = rand() % 40;
		}
		npc[j] = paidui[k];
		paidui[k] = 0;  //电脑抽四张牌，抽完牌堆处的数就清零
		npc_shoupai_num = 4;
	}
	turn();
}

void show()
{
	printf("'英雄'还有%d张手牌", npc_shoupai_num);   //‘英雄’指字符，下同；
	printf("\n\n\n\n\n");
	printf("你（英雄）还有%d张手牌\n", player_shoupai_num);
	printf("一号位：%s\n",c_player[0]);
	printf("二号位：%s\n", c_player[1]);
	printf("三号位：%s\n", c_player[2]);
	printf("四号位：%s\n", c_player[3]);
	printf("请出牌：");
	scanf_s("%d",&player_out);    //玩家输入排位号
	player_out--;00
	

}


void upwhitoutInput()
{
	printf("%s", c_player[player_out]);     //玩家输出的牌对应的字符2
	

}

void upwhitInput()
{
	
}


int main()
{
	startup();  //数据初始化
	show();  //显示
	upwhitoutInput();  //更新无输入
	upwhitInput();  //更新有输入
	
	return 0;
}